<html>
<?php include("../../MerchandiseBay/conn.php"); ?>
<head>
<?

$sqlTotal="select count(*) as totalproduct from merchandise";
$sqlSold="select count(*) as soldproduct from merchandise where sold_date!='00000000'";
$sqlLeft="select count(*) as leftproduct from Merchandise where sold_date='00000000'";


$qryTotal=mysql_query($sqlTotal,$conn);
$qrySold=mysql_query($sqlSold,$conn);
$qryLeft=mysql_query($sqlLeft,$conn);



$rowTotal=mysql_fetch_assoc($qryTotal);
$rowSold=mysql_fetch_assoc($qrySold);
$rowLeft=mysql_fetch_assoc($qryLeft);



$sqlDetail="select * from merchandise where sold_date!='00000000'";
$qryDetail=mysql_query($sqlDetail,$conn);

?>

<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Jumlah kereta keseluruhan</title>
</head>

<body bgcolor="#0099FF">

<table width="47%" border="0" bordercolor="#0066FF" id="table1">
  <tr> 
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td bgcolor="#FFFF99"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<b>Total 
      of all product :</b> 
      <?=$rowTotal['totalproduct']?>
      </font></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFF99"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<b>Total 
      Product Sold &nbsp;:</b> 
      <?=$rowSold['soldproduct']?>
      </font></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFF99"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<b>Total 
      Product Left &nbsp;&nbsp;:</b> 
      <?=$rowLeft['leftproduct']?>
      </font></td>
  </tr>
  <tr> 
    <td>&nbsp;</td>
  </tr>
</table>

<table border="1" width="100%" id="table2">
  <tr> 
    <td height="37" colspan="6" bgcolor="#FFFFFF"><div align="right"><b></b></div>
      <div align="center"> 
        <p><font color="#000099"><strong> Sold FOOD Information</strong></font></p>
      </div></td>
  </tr>
  <tr> 
    <td width="108" bgcolor="#CCCCCC"><b><font size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;Menu Code 
     </font></b></td>
    <td width="101" bgcolor="#CCCCCC"><b><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> 
      Category</font></b></td>
    <td width="182" bgcolor="#CCCCCC"><b><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Kind</font></b></td>
    <td width="160" bgcolor="#CCCCCC"><b><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Price</font></b></td>
    <td width="191" bgcolor="#CCCCCC"><b><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> 
      Entered Date </font></b></td>
    <td width="225" bgcolor="#CCCCCC"><b><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Sold 
      Date</font></b></td>
  </tr>
  <?while($rowDetail=mysql_fetch_assoc($qryDetail)){?>
  <tr> 
    <td width="108"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp; 
      <?=$rowDetail['regno']?>
      </font></td>
    <td width="101"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp; 
      <?=$rowDetail['category']?>
      </font></td>
    <td><font size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp; 
      <?=$rowDetail['kind']?>
      </font></td>
    <td width="160"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp; 
      <?=$rowDetail['price']?>
      </font></td>
    <td width="191"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp; 
      <?=$rowDetail['entered_date']?>
      </font></td>
    <td width="225"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp; 
      <?=$rowDetail['sold_date']?>
      </font></td>
  </tr>
  <?}?>
  <tr> 
    <td width="108">&nbsp;</td>
    <td width="101">&nbsp;</td>
    <td>&nbsp;</td>
    <td width="160">&nbsp;</td>
    <td width="191">&nbsp;</td>
    <td width="225">&nbsp;</td>
  </tr>
</table>

</body>

</html>